<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>unbind([type],[data])</title>
<meta name="keywords" content="jQuery 1.2 API Reference,Visual jQuery 1.2,jQuery doc,jQuery API,jQuery,jQuery 1.2 API 参考文档中文版,中文版" />
<meta name="description" content="jQuery 1.2 API 文档中文版，提供最新版 jQuery 开发帮助。" />
<link rel="stylesheet" type="text/css" href="../../style/jqueryapi.css" />
<script type="text/javascript" src="../../style/lib/jquery126.js"></script>
 </script>
<script type="text/javascript" src="../../style/jqueryapi.js"></script>
<link rel="shortcut icon" href="../../style/img/favicon.ico" />
</head>
<body>
<div id="topnav">
		<a href="http://www.jQuery.com/" title="jQuery官网" target="_blank" class="topnav">jQuery官网</a>
	<span class="topnav">|</span>
	<a href="http://jquery.org.cn/" title="jQuery中文网站" target="_blank" class="topnav">jQuery中文网站</a>
	<span class="topnav">|</span>
	<a href="http://www.cn-cuckoo.com/" title="1.1版译者" target="_blank" class="topnav">为之漫笔</a>
	<span class="topnav">|</span>
	<a href="http://shawphy.com/" title="1.2版翻译整理者" target="_blank" class="topnav">Shawphy</a>
    <span class="topnav">|</span>
	<a href="http://www.51toria.cn" title="CHM文档制作者:一揪" target="_blank" class="topnav">CHM文档制作者</a> 
	<span class="topnav">|</span>
	<a href="http://dl.getdropbox.com/u/81097/jQueryAPI_CHM.CHM" title="" target="_blank" class="topnav">CHM最新版本下载</a> 
</div>
<hr style="color:#595959;" />

<div class="content">
				<h1>unbind([type],[data])</h1>
				<div class="desc"><div>bind()的反向操作，从每一个匹配的元素中删除绑定的事件。</div> <div class="longdesc"><p>如果没有参数，则删除所有绑定的事件。</p><p>你可以将你用bind()注册的自定义事件取消绑定。</p><p>I如果提供了事件类型作为参数，则只删除该类型的绑定事件。</p><p>如果把在绑定时传递的处理函数作为第二个参数，则只有这个特定的事件处理函数会被删除。</p></div></div><hr />
				<div class="desc"><div>This does the opposite of bind, it removes bound events from each of the matched elements.</div> <div class="longdesc"><p>Without any arguments, all bound events are removed.</p><p>You can also unbind custom events registered with bind.</p><p>If the type is provided, all bound events of that type are removed.</p><p>If the function that was passed to bind is provided as the second argument, only that specific event handler is removed.</p></div></div>
				<h2>返回值</h2>
				<p class="indent">jQuery</p>
				<h2>参数</h2>
				<p class="indent"><strong>type </strong>(String) : (可选) 事件类型</p>
				<p class="indent"><strong>data </strong>(Function) : (可选) 要从每个匹配元素的事件中反绑定的事件处理函数</p>
				<h2>示例</h2>
				<p class="indent">
					把所有段落的所有事件取消绑定
				</p>
				<p class="indent"><strong>jQuery 代码:</strong></p>
				<div class="code">
					$("p").unbind() 
				</div>
				<hr />
				<p class="indent">
					将段落的click事件取消绑定
				</p>
				<p class="indent"><strong>jQuery 代码:</strong></p>
				<div class="code">
					$("p").unbind( "click" ) 
				</div>
				<hr />
				<p class="indent">
					删除特定函数的绑定，将函数作为第二个参数传入
				</p>
				<p class="indent"><strong>jQuery 代码:</strong></p>
				<div class="code">
					var foo = function () {<br/>
&nbsp; // 处理某个事件的代码<br/>
};<br/>
<br/>
$("p").bind("click", foo); // ... 当点击段落的时候会触发 foo <br/>
<br/>
$("p").unbind("click", foo); // ... 再也不会被触发 foo <br/>
				</div>
			</div>
            
</body>
</html>
